package com.feng.cloud.common.response;

import com.feng.cloud.common.exception.auth.AuthStatus;
import com.feng.cloud.common.exception.system.SystemStatus;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * @ClassName BaseResponse
 * @Description TODO
 * @Author Better Feng
 * @Date 2019/12/12 15:33
 * @Version 1.0
 **/
@Getter
@Setter
@ToString
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class BaseResponse {
    private int status = 200;
    private String message = "操作成功";

    public BaseResponse message(String message) {
        this.setMessage(message);
        return this;
    }

    public BaseResponse(int status) {
        this.status = status;
    }

    public BaseResponse(AuthStatus authStatus) {
        this.status = authStatus.getStatus();
        this.message = authStatus.getMessage();
    }
    public BaseResponse(SystemStatus systemStatus) {
        this.status = systemStatus.getStatus();
        this.message = systemStatus.getMessage();
    }
}
